package org.example.Service.ServiceImpl;

import org.example.Service.BookService;
import org.example.mapper.AuthorsMapper;
import org.example.mapper.BooksMapper;
import org.example.pojo.Books;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service


public class BookServiceImpl implements BookService {
    @Autowired
    private BooksMapper booksMapper;


    @Override
    public void addBook(Books books) {
        booksMapper.addBook(books);
    }

    @Override
    public void deleteBook(int id) {
        booksMapper.deleteBook(id);
    }

    @Override
    public void updateBook(Books books) {
        booksMapper.updateBook(books);
    }

    @Override
    public Books selectOneBook(int id) {
        Books b=booksMapper.selectOneBook(id);
        return b;
    }

    @Override
    public List<Books> selectAllBook() {
        return booksMapper.selectAllBook();
    }
}
